package com.docking.heylo.service;

import com.docking.heylo.dao.entity.Appointment;
import com.docking.heylo.dao.entity.Coupon;
import com.docking.heylo.enums.EPayMethod;
import com.docking.heylo.web.dto.AppointmentDto;
import com.docking.heylo.web.dto.OrderPayDto;
import com.github.pagehelper.PageInfo;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface IAppointmentService {

    /***
     * 发起约拍
     *
     * @param appointment
     */
    void initiate(Appointment appointment);

    /***
     * 费用配置
     *
     * @return
     */
    List<Map<String,Object>> costConf();

    /***
     * 查看用户的约拍订单
     *
     * @param appointmentDto
     * @return
     */
    PageInfo<Map<String,Object>> orders(AppointmentDto appointmentDto);

    /***
     * 开始约拍
     *
     * @param appointmentDto
     */
    void start(AppointmentDto appointmentDto);

    /***
     * 申请订单支付
     *
     * @param orderPayDto
     * @return
     */
    Object payAppointment(OrderPayDto orderPayDto);

    /***
     * 支付成功回调
     *  @param orderNo           订单号
     * @param payMethod         支付方式
     * @param b
     */
    void paymentCallback(String orderNo, EPayMethod payMethod, boolean b);


    Coupon couponByCode(String promoCode);

    /**
     * 结束约拍
     *
     * @param app
     */
    void end(Appointment app);

    /***
     * 结束约拍
     * @param app
     */
    void endAppointment(Appointment app);


    void accept(AppointmentDto dto);

    void refuse(AppointmentDto dto);

    void testPayOrder(AppointmentDto appointmentDto);

    /***
     * 查询没有确认的订单
     *
     * @return
     */
    List<Appointment> selectNotConfirmationList();


    void automaticConfirmation();

    /***
     * 提交订单申诉
     *
     * @param appointment
     */
    void appeal(Appointment appointment);


}
